package com.techsoul.admin.controller;

import com.techsoul.common.core.pojo.Result;
import com.techsoul.module.marketing.pojo.param.CouponActivitySearchParam;
import com.techsoul.module.marketing.service.ICouponActivityService;
import com.techsoul.module.marketing.service.IFlashSaleSessionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 店铺 控制器
 *
 * @author liuen
 */
@Api(tags = "店铺")
@RestController
@RequestMapping("/api/marketing")
public class SingleMarketingController {

    @Autowired
    private Result result;

    @Autowired
    private IFlashSaleSessionService flashSaleSessionService;

    @Autowired
    private ICouponActivityService couponActivityService;

    @ApiOperation("限时折扣场次-列表")
    @PostMapping("/flashSaleSession/list")
    public Result flashSaleSessionList() {
        return result.success(flashSaleSessionService.flashSaleSessionList());
    }

    @ApiOperation("店铺内可领取的优惠券列表")
    @PostMapping("/coupon/unRecivedCouponList")
    public Result unRecivedCouponList(@RequestBody CouponActivitySearchParam params) {
        return result.success(this.couponActivityService.unRecivedCouponList(params));
    }

}
